package com.ybc.chinese.fragment;

import android.app.ProgressDialog;
import android.support.v4.app.Fragment;

import com.ybc.chinese.R;
import com.ybc.chinese.utils.DialogUtil;

/**
 * <p><p/>
 * Created by Yubch on 17/1/17.
 */
public class BaseFragment extends Fragment {
    private ProgressDialog mRunningDialog;

    protected void showRunningDialog() {
        if (mRunningDialog == null) {
            mRunningDialog = DialogUtil.getProgressDialog(getActivity(), R.string.running);
        }
        if (!mRunningDialog.isShowing()) {
            mRunningDialog.show();
        }

    }

    protected void dismissRunningDialog() {
        if (mRunningDialog != null && mRunningDialog.isShowing()) {
            mRunningDialog.dismiss();
        }
    }
}
